Skip to content

Conversation

@jage
Copy link
Member

@jage jage commented Nov 28, 2025

Remove progress, success, and error messages from stdout. Commands now output only JSON or nothing, using exit codes for errors.

Remove progress, success, and error messages from stdout.
Commands now output only JSON or nothing, using exit codes for errors.
@jage jage requested review from dentarg and snichme November 28, 2025 06:08
@jage
Copy link
Member Author

jage commented Nov 28, 2025

I tried using checking if we had a TTY or pipe output to toggle output, but thought it was too complex at this stage. Think it's better we try to make it super simple, then we can add fancy feedback/UI as optional things (could be automatic via TTY check).

Please test this version out and really think if this is a good direction or not :)

I hope this makes scripting easier, and keeping a more focused "Unix" style of not being too chatty, rely on exit status etc.

@snichme
Copy link
Member

snichme commented Nov 28, 2025

How about output errors to stderr instead?

@jage
Copy link
Member Author

jage commented Nov 28, 2025

How about output errors to stderr instead?

Yeah, well the idea is that cobra will decide on the errors (right now it will print to stderr).

@dentarg
Copy link
Member

dentarg commented Dec 2, 2025

I'm feels like I'm missing some context, when do you get JSON from the CLI? There are still the tables with instances, plugins etc.?

@jage
Copy link
Member Author

jage commented Dec 3, 2025

I'm feels like I'm missing some context, when do you get JSON from the CLI? There are still the tables with instances, plugins etc.?

Yes it's a mix, but if we want it "scriptable" we need a consistent output format. Could be table (without headers) and/or JSON. Now it's a mix:

$ cloudamqp regions
Available regions:
[
  {
    "provider": "amazon-web-services",
    "region": "us-east-1",
    "name": "Amazon Web Services - US-East-1 (Northern Virginia)",
    "has_shared_plans": true
  },
...

Regardless of JSON/table we don't want any non-data text in stdout (stderr is fine, but also want to handle errors in a consistent manner)

@dentarg
Copy link
Member

dentarg commented Dec 3, 2025

Oh TIL, I opened a bug for that: #22

I think everything should be nice human-readable output by default and that you should request the JSON output.

@jage jage closed this Dec 18, 2025
@dentarg dentarg deleted the silence branch December 18, 2025 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants